﻿{template 'yellow/header'}
{if $reply['isindexslide']==1}
{template 'yellow/sider'}
{/if}
<style type="text/css">
	.slide{    border-bottom: 1px solid #000;}
</style>
<div class="divmain1"><img src="{php echo tomedia($reply['topimg']);}" alt="shareImg"></div>

<div class="num_box">
	<ul class="num_box_ul bg-blue2">
		<li><span class="text"><i class="glyphicon glyphicon-paperclip"></i> 已报名</span> <span>{$jointotal}</span></li>
		<li><span class="text"> <i class="glyphicon glyphicon-thumbs-up"></i> 累计投票</span> <span>{$votetotal}</span></li>
		<li><span class="text"><i class="glyphicon glyphicon-eye-open"></i> 访问量</span> <span>{$pvtotal}</span></li>
	</ul>

	<script type="text/javascript">
var intDiff = parseInt({php echo $reply['endtime']-time();});//倒计时总秒数量
function timer(intDiff){
	window.setInterval(function(){
	var day=0,
		hour=0,
		minute=0,
		second=0;//时间默认值		
	if(intDiff > 0){
		day = Math.floor(intDiff / (60 * 60 * 24));
		hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
		minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
		second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
	}
	if (minute <= 9) minute = '0' + minute;
	if (second <= 9) second = '0' + second;
	$('#day_show').html(day+"天");
	$('#hour_show').html('<s id="h"></s>'+hour+'时');
	$('#minute_show').html('<s></s>'+minute+'分');
	$('#second_show').html('<s></s>'+second+'秒');
	intDiff--;
	}, 1000);
} 

$(function(){
	timer(intDiff);
});	
</script>
<div class="time-item pd-10 bg-blue3 bg-bw pd-b-15">
    <div class="day cl-white">活动结束倒计时</div>
	<strong id="day_show">0天</strong>
	<strong id="hour_show">0时</strong>
	<strong id="minute_show">0分</strong>
	<strong id="second_show">0秒</strong>
</div>
	
<div class="bg-blue4 pd-l-10 pd-r-10 pd-b-10">
{if $voteuser['id']!=""}
<div class='join_us'><a href='{php echo $this->createMobileUrl('view', array('rid' => $reply['rid'],'id'=>$voteuser['id']))}'>我的投票</a></div>
{else}
	{if $aptime!=2}
	<div class='join_us'><a href='{php echo $this->createMobileUrl('join', array('rid' => $reply['rid']))}'>我要报名</a></div>
	{/if}
{/if}

</div>

</div>

<div class="divmain11 clearfix bg-blue3">
  <input type="text" value="" name="sci" placeholder="请输入编号或姓名" class="inputtxt">
  <div class="divsub" onclick="get_list(1);">搜&nbsp;索</div>
</div>

<section class="content bg-blue3 bg-bw" id="toupiao">
<div id="pageCon" style="padding-bottom: 10px">
<ul class="list_box clearfix" id="list_box" style="position: relative;">
</ul>
<div id="list_more" class="box cl-white" style="margin-top: 16px; text-align: center;margin-bottom: 40px;"><span class="am-text-secondary" onclick="get_list(0);">查看更多</span></div>
</div>
</section>

<div style="clear:both;"></div>
<!--div class="page">
          <div class="page1">上一页</div>
              <div class="page3"><a href="main.php?orders=&sci=&page=2">下一页</a></div>
        
</div -->
 <!--<div class="tabtitle bg-blue5 cl-white">
       <i class="fa fa-file-text-o"></i> 活动规则
 </div>-->
<div class="divmain10 pd-10 bg-blue4">
	<div class="bg-blue5 cl-white" style="width:40%; border-radius:20px; height:36px; line-height:36px;margin:0 auto; text-align:center;">活动规则</div>
  <div class="divcon">
  {if $reply['eventrule']==""}
     请至后台编辑活动，设置活动规则内容，支持HTML！
  {else}
	 {$reply['eventrule']}
  {/if}
  
  </div>
</div>

<div class="copyright bg-blue4"></div>

{template 'nav_footer'}

<script type="text/javascript">
var limit = 1;
function get_list(ty){
    
    if(ty==1){
	   var keyword=$("input[name='sci']").val();
	   if(keyword==""){
	      dialog2("请输入编号或姓名");
		  return false;
	   }
	   $("#pageCon .list_box").html('');
	}else{
	   $("#list_more").html('<div class="am-text-secondary"><span class="am-icon-spinner am-icon-spin"></span> 卖命加载中...</div>');
	   var keyword="";
	}
	
	$.ajax({
	    type : "post",
	    url : "{php echo $this->createMobileUrl('Index',array('rid'=>$rid))}",
	    data : {
	    	limit:limit,
			keyword:keyword
	    },
        dataType : "json",		
	    success : function(data) {
	    	if(data.status==200){
						var list = data.content;
						var content = '';
						for(var i=0; i<list.length; i++){
							content += '<li class="picCon"><div>'
							+'<i class="number">'+list[i]['noid']+'号，'+list[i]['votenum']+'票</i>'
							+'<a href="'+list[i]['url']+'" class="img"><img src="'+list[i]['img1']+'"></a>'
							+'<div class="clearfix"><p>'+list[i]['name']+'</p>'
							+'<a href="'+list[i]['url']+'" class="vote">投票</a></div>'
							+'</div></li>';
							
						}
                        $("#pageCon .list_box").append(content);
						if(list.length==10){
							$("#list_more").html('<span class="am-text-secondary" onclick="get_list(0);">查看更多</span>');
						}else{
							$("#list_more").html('<span></span>');
						}		
	                    limit++;

						

waterfall();
		    }else if(data.status==-103){
	    		$("#list_more").html('<span>没有更多记录！</span>');
	    	}else if(data.status==301){
	    		$("#list_more").html('<span>没有搜索到内容！</span>');
	    	}else{
			    $("#list_more").html('<span>没有更多记录！</span>');
			}    	
	    },
	    error : function(xhr, type) {

	    }
	});
	    

}
get_list(0);

function waterfall(limit){
$container = $('#list_box');
$container.masonry('reload');
	$container.imagesLoaded(function() {
		$container.masonry({
			itemSelector: '.picCon',
			gutter: 20,
			isAnimated: true,
			});
		});
}

{if  $reply['indexsound']}
			$("body").append('<div class="video_exist play_yinfu" id="audio_btn" style="display: block;"><div id="yinfu" class="rotate"></div><audio preload="auto" autoplay="autoplay" id="media" src="{media $reply['indexsound']}" loop></audio></div>');
			$("#media")[0].play();
			$("#audio_btn").click(function() {
				$(this).hasClass("off") ? ($(this).addClass("play_yinfu").removeClass("off"), $("#yinfu").addClass("rotate"), $("#media")[0].play()) : ($(this).addClass("off").removeClass("play_yinfu"), $("#yinfu").removeClass("rotate"), $("#media")[0].pause())
			})
{/if}
    
</script>
<script src="//cdn.bootcss.com/masonry/2.1.08/jquery.masonry.min.js"></script>
{template 'yellow/footer'}